package com.qiuyang.service;

import com.github.pagehelper.PageHelper;
import com.qiuyang.mapper.BlogMapper;
import com.qiuyang.pojo.Blog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Service
public class BlogServiceImpl implements BlogService{

    @Autowired
    public BlogMapper blogMapper;

    @Override
    public Blog findBlogById(Long id) {
        return blogMapper.findBlogById(id);
    }

    @Override
    public void updateBlog(Blog blog) {
        blogMapper.updateBlog(blog);
    }

    @Override
    public void deleteBlog(Long id) {
        blogMapper.deleteById(id);
    }

    @Override
    public List<Blog> findBlogs() {
        return blogMapper.findBlog();
    }

    @Override
    public List<Blog> findByTitle(String title) {
        return blogMapper.findByTitle(title);
    }

    @Override
    public void insertBlogTags(Map<String, Object> map) {
        blogMapper.insertBlogTags(map);
    }

    @Override
    public Long findMaxId() {
        return blogMapper.findMaxId();
    }

    @Override
    public void updateBlogTags(Map<String, Object> map) {
        blogMapper.updateBlogTags(map);
    }

    @Override
    public String findAllBlogTags(Long blogsId) {
        return blogMapper.findAllBlogTags(blogsId);
    }

    @Override
    public void deleteBlogTag(Long blogsId) {
        blogMapper.deleteBlogTag(blogsId);
    }

    @Override
    public List<Blog> findAllBlog() {
        return blogMapper.findAllBlog();
    }


    @Override
    public void insertBlog(Blog blog) {
        blogMapper.insertBlog(blog);
    }







}
